3.1320 \(\int (c (d \tan (e+f x))^p)^n (a+i a \tan (e+f x)) \, dx\)

Optimal. Leaf size=54 \[ \frac{a \tan (e+f x) \, _2F_1(1,n p+1;n p+2;i \tan (e+f x)) \left (c (d \tan (e+f x))^p\right )^n}{f (n p+1)} \]

[Out]

(a*Hypergeometric2F1[1, 1 + n*p, 2 + n*p, I*Tan[e + f*x]]*Tan[e + f*x]*(c*(d*Tan[e + f*x])^p)^n)/(f*(1 + n*p))

________________________________________________________________________________________

Rubi [A]  time = 0.104539, antiderivative size = 54, normalized size of antiderivative = 1., number of steps used = 4, number of rules used = 3, integrand size = 28, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.107, Rules used = {12, 6677, 64} \[ \frac{a \tan (e+f x) \, _2F_1(1,n p+1;n p+2;i \tan (e+f x)) \left (c (d \tan (e+f x))^p\right )^n}{f (n p+1)} \]

Antiderivative was successfully verified.

[In]

Int[(c*(d*Tan[e + f*x])^p)^n*(a + I*a*Tan[e + f*x]),x]

[Out]

(a*Hypergeometric2F1[1, 1 + n*p, 2 + n*p, I*Tan[e + f*x]]*Tan[e + f*x]*(c*(d*Tan[e + f*x])^p)^n)/(f*(1 + n*p))

Rule 12

Int[(a_)*(u_), x_Symbol] :> Dist[a, Int[u, x], x] /; FreeQ[a, x] &&  !MatchQ[u, (b_)*(v_) /; FreeQ[b, x]]

Rule 6677

Int[(u_)*((c_.)*((a_.) + (b_.)*(x_))^(n_))^(p_), x_Symbol] :> Dist[(c^IntPart[p]*(c*(a + b*x)^n)^FracPart[p])/
(a + b*x)^(n*FracPart[p]), Int[u*(a + b*x)^(n*p), x], x] /; FreeQ[{a, b, c, n, p}, x] &&  !IntegerQ[p] &&  !Ma
tchQ[u, x^(n1_.)*(v_.) /; EqQ[n, n1 + 1]]

Rule 64

Int[((b_.)*(x_))^(m_)*((c_) + (d_.)*(x_))^(n_), x_Symbol] :> Simp[(c^n*(b*x)^(m + 1)*Hypergeometric2F1[-n, m +
 1, m + 2, -((d*x)/c)])/(b*(m + 1)), x] /; FreeQ[{b, c, d, m, n}, x] &&  !IntegerQ[m] && (IntegerQ[n] || (GtQ[
c, 0] &&  !(EqQ[n, -2^(-1)] && EqQ[c^2 - d^2, 0] && GtQ[-(d/(b*c)), 0])))

Rubi steps

\begin{align*} \int \left (c (d \tan (e+f x))^p\right )^n (a+i a \tan (e+f x)) \, dx &=\frac{i \operatorname{Subst}\left (\int \frac{a \left (c (d x)^p\right )^n}{i+x} \, dx,x,\tan (e+f x)\right )}{f}\\ &=\frac{(i a) \operatorname{Subst}\left (\int \frac{\left (c (d x)^p\right )^n}{i+x} \, dx,x,\tan (e+f x)\right )}{f}\\ &=\frac{\left (i a (d \tan (e+f x))^{-n p} \left (c (d \tan (e+f x))^p\right )^n\right ) \operatorname{Subst}\left (\int \frac{(d x)^{n p}}{i+x} \, dx,x,\tan (e+f x)\right )}{f}\\ &=\frac{a \, _2F_1(1,1+n p;2+n p;i \tan (e+f x)) \tan (e+f x) \left (c (d \tan (e+f x))^p\right )^n}{f (1+n p)}\\ \end{align*}

Mathematica [B]  time = 0.946716, size = 173, normalized size = 3.2 \[ \frac{a e^{-i e} 2^{-n p-1} \cos (e+f x) (1+i \tan (e+f x)) (\cos (f x)-i \sin (f x)) \left (-\frac{i \left (-1+e^{2 i (e+f x)}\right )}{1+e^{2 i (e+f x)}}\right )^{n p+1} \left (1+e^{2 i (e+f x)}\right )^{n p+1} \, _2F_1\left (n p+1,n p+1;n p+2;\frac{1}{2} \left (1-e^{2 i (e+f x)}\right )\right ) \tan ^{-n p}(e+f x) \left (c (d \tan (e+f x))^p\right )^n}{f n p+f} \]

Antiderivative was successfully verified.

[In]

Integrate[(c*(d*Tan[e + f*x])^p)^n*(a + I*a*Tan[e + f*x]),x]

[Out]

(2^(-1 - n*p)*a*(((-I)*(-1 + E^((2*I)*(e + f*x))))/(1 + E^((2*I)*(e + f*x))))^(1 + n*p)*(1 + E^((2*I)*(e + f*x
)))^(1 + n*p)*Cos[e + f*x]*Hypergeometric2F1[1 + n*p, 1 + n*p, 2 + n*p, (1 - E^((2*I)*(e + f*x)))/2]*(Cos[f*x]
 - I*Sin[f*x])*(1 + I*Tan[e + f*x])*(c*(d*Tan[e + f*x])^p)^n)/(E^(I*e)*(f + f*n*p)*Tan[e + f*x]^(n*p))

________________________________________________________________________________________

Maple [F]  time = 3.853, size = 0, normalized size = 0. \begin{align*} \int \left ( c \left ( d\tan \left ( fx+e \right ) \right ) ^{p} \right ) ^{n} \left ( a+ia\tan \left ( fx+e \right ) \right ) \, dx \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((c*(d*tan(f*x+e))^p)^n*(a+I*a*tan(f*x+e)),x)

[Out]

int((c*(d*tan(f*x+e))^p)^n*(a+I*a*tan(f*x+e)),x)

________________________________________________________________________________________

Maxima [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int{\left (i \, a \tan \left (f x + e\right ) + a\right )} \left (\left (d \tan \left (f x + e\right )\right )^{p} c\right )^{n}\,{d x} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((c*(d*tan(f*x+e))^p)^n*(a+I*a*tan(f*x+e)),x, algorithm="maxima")

[Out]

integrate((I*a*tan(f*x + e) + a)*((d*tan(f*x + e))^p*c)^n, x)

________________________________________________________________________________________

Fricas [F]  time = 0., size = 0, normalized size = 0. \begin{align*}{\rm integral}\left (\frac{2 \, \left (c \left (\frac{-i \, d e^{\left (2 i \, f x + 2 i \, e\right )} + i \, d}{e^{\left (2 i \, f x + 2 i \, e\right )} + 1}\right )^{p}\right )^{n} a e^{\left (2 i \, f x + 2 i \, e\right )}}{e^{\left (2 i \, f x + 2 i \, e\right )} + 1}, x\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((c*(d*tan(f*x+e))^p)^n*(a+I*a*tan(f*x+e)),x, algorithm="fricas")

[Out]

integral(2*(c*((-I*d*e^(2*I*f*x + 2*I*e) + I*d)/(e^(2*I*f*x + 2*I*e) + 1))^p)^n*a*e^(2*I*f*x + 2*I*e)/(e^(2*I*
f*x + 2*I*e) + 1), x)

________________________________________________________________________________________

Sympy [F]  time = 0., size = 0, normalized size = 0. \begin{align*} a \left (\int \left (c \left (d \tan{\left (e + f x \right )}\right )^{p}\right )^{n}\, dx + \int i \left (c \left (d \tan{\left (e + f x \right )}\right )^{p}\right )^{n} \tan{\left (e + f x \right )}\, dx\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((c*(d*tan(f*x+e))**p)**n*(a+I*a*tan(f*x+e)),x)

[Out]

a*(Integral((c*(d*tan(e + f*x))**p)**n, x) + Integral(I*(c*(d*tan(e + f*x))**p)**n*tan(e + f*x), x))

________________________________________________________________________________________

Giac [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int{\left (i \, a \tan \left (f x + e\right ) + a\right )} \left (\left (d \tan \left (f x + e\right )\right )^{p} c\right )^{n}\,{d x} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((c*(d*tan(f*x+e))^p)^n*(a+I*a*tan(f*x+e)),x, algorithm="giac")

[Out]

integrate((I*a*tan(f*x + e) + a)*((d*tan(f*x + e))^p*c)^n, x)